import allure
from page_object.page_roncoo_pay_login import PageLogin
from page_element.el_Roncoo import *
import logging



class InitiateSettlement(PageLogin):
    """发起结算"""

    def page_initiate_settlement(self):
        # 前置条件：已登录
        # self.page_login('admin', '123456')
        with allure.step("点击结算管理"):
            self.click(settle_manage.settlement_manage)
        with allure.step("点击结算记录管理"):
            self.click(settle_manage.settlement_records_manage)
        with allure.step("点击发起结算"):
            self.click(settle_manage.initiate_settlement_btn)
        with allure.step("点击放大镜图标"):
            self.click(settle_manage.magnifier_tb)
        with allure.step("点击查找带回"):
            self.click(settle_manage.find_back)
        with allure.step("点击获取可结算余额"):
            self.click(settle_manage.get_Settle_balance)
        with allure.step("输入结算余额"):
            self.send_keys(settle_manage.settle_balance,'0')
        with allure.step("点击提交"):
            self.click(settle_manage.submit_btn)

        # # 断言
        # with allure.step("验证搜索出来的用户名"):
        #     dy = self.text(settle_manage.dy_username_text)
        #     assert '刘北' in dy, '断言失败(验证失败)'
        #     print(f'断言的内容:刘北 在 {dy}')
        #     logging.info(f'断言的内容:退出系统 在 {dy}')





